From: Stefano Facchini Date: Wed, 1 Nov 2017 18:43:11 +0000 (+0100) Subject: panel: focus windows on Escape key press X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~994^2^2~156 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=feed029ae471976aeeb7d4d5a6532a53f06437ca;p=gnome-shell.git panel: focus windows on Escape key press https://bugzilla.gnome.org/show_bug.cgi?id=671121 --- diff --git a/js/ui/panel.js b/js/ui/panel.js index e90d65beb..d9b1a32ef 100644 --- a/js/ui/panel.js +++ b/js/ui/panel.js @@ -797,6 +797,7 @@ var Panel = new Lang.Class({ this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight)); this.actor.connect('allocate', Lang.bind(this, this._allocate)); this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPress)); + this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPress)); Main.overview.connect('showing', Lang.bind(this, function () { this.actor.add_style_pseudo_class('overview'); @@ -964,6 +965,16 @@ var Panel = new Lang.Class({ return Clutter.EVENT_STOP; }, + _onKeyPress: function(actor, event) { + let symbol = event.get_key_symbol(); + if (symbol == Clutter.KEY_Escape) { + global.screen.focus_default_window(event.get_time()); + return Clutter.EVENT_STOP; + } + + return Clutter.EVENT_PROPAGATE; + }, + _toggleMenu: function(indicator) { if (!indicator) // menu not supported by current session mode return;